<ui:composition xmlns:h="http://java.sun.com/jsf/html"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:fn="http://java.sun.com/jsp/jstl/functions"
		xmlns:g="http://code.google.com/p/ada-ado/generator"
                xmlns:u="http://code.google.com/p/ada-asf/util"
		xmlns:f="http://java.sun.com/jsf/core">
   function Get_Value (From : in #{fn:capitalize(bean.type)}#{bean.isBean ? '' : '_Ref'};
                       Name : in String) return Util.Beans.Objects.Object is
<h:panelGroup rendered="#{not bean.isBean}">
      Obj  : constant ADO.Objects.Object_Record_Access := From.Get_Load_Object;
      Impl : access #{fn:capitalize(bean.type)}_Impl;
   begin
      if Obj = null then
         return Util.Beans.Objects.Null_Object;
      end if;
      Impl := #{fn:capitalize(bean.type)}_Impl (Obj.all)'Access;
</h:panelGroup>
<h:panelGroup rendered="#{bean.isBean}">
   begin
</h:panelGroup>
<h:list value="#{bean.members}" var="column">
  <h:panelGroup rendered="#{not column.isVersion and (column.type.isPrimitiveType or column.type.isEnum)}">
      #{column.rowIndex ge 2 ? 'els' : ''}if Name = "#{column.name}" then
    <h:panelGroup rendered="#{column.name eq bean.id.name}">
         return ADO.Objects.To_Object (#{impl}.Get_Key);
    </h:panelGroup>
    <h:panelGroup rendered="#{column.type.isEnum}">
         return #{column.type.name}_Objects.To_Object (#{impl}.#{fn:capitalize(column.name)});
    </h:panelGroup>
    <h:panelGroup rendered="#{column.name ne bean.id.name}">
      <h:panelGroup rendered="#{column.type.isInteger or column.type.isIdentifier}">
         return Util.Beans.Objects.To_Object (Long_Long_Integer (#{impl}.#{fn:capitalize(column.name)}));
      </h:panelGroup>
      <h:panelGroup rendered="#{column.type.isDate and g:adaType(column,1) ne 'ADO.Nullable_Time'}">
         return Util.Beans.Objects.Time.To_Object (#{impl}.#{fn:capitalize(column.name)});
      </h:panelGroup>
      <h:panelGroup rendered="#{column.type.isDate and g:adaType(column,1) eq 'ADO.Nullable_Time'}">
         if #{impl}.#{fn:capitalize(column.name)}.Is_Null then
            return Util.Beans.Objects.Null_Object;
         else
            return Util.Beans.Objects.Time.To_Object (#{impl}.#{fn:capitalize(column.name)}.Value);
         end if;
      </h:panelGroup>
    <h:panelGroup rendered="#{not column.type.isInteger and not column.type.isEnum and not column.type.isIdentifier and not column.type.isDate}">
         return Util.Beans.Objects.To_Object (#{impl}.#{fn:capitalize(column.name)});
  </h:panelGroup>
</h:panelGroup>
</h:panelGroup></h:list>
<h:panelGroup rendered="#{bean.columns.size ge 1}">
      end if;
</h:panelGroup>
<h:panelGroup rendered="#{not empty bean.parent}">
      return #{fn:capitalize(bean.parent.name)}_Ref (#{impl}).Get_Value (Name);
</h:panelGroup>
<h:panelGroup rendered="#{empty bean.parent}">
      return Util.Beans.Objects.Null_Object;
</h:panelGroup>
   end Get_Value;
#{''}
</ui:composition>
